#
#   Demonstrate alpha test
#
sel ('/usr/scene')
execfile ('licht.py')
animmesh=new ('n3dnode','animmesh')
sel ('animmesh')
rx=new ('nipol','rx')
sel ('rx')
rx.connect('rx')
rx.addkey1f(0,0)
rx.addkey1f(50,360)
sel ('..')
rz=new ('nipol','rz')
sel ('rz')
rz.connect('rz')
rz.addkey1f(0,0)
rz.addkey1f(60,360)
sel ('..')
mesh=new ('nmeshnode','mesh')
sel ('mesh')
mesh.setfilename("../meshes/torus1.n3d")
sel ('..')
sn=new ('nshadernode','sn')
sel ('sn')
sn.setnumstages(3)
sn.setcolorop(0,"replace tex" )
sn.setcolorop(1,"adds -tex prev" )
sn.setcolorop(2,"add tex prev" )
sn.setalphaop(2,"mul tex prev" )
sn.begintunit(0)
sn.setaddress('wrap','wrap')
sn.setminmagfilter('linear','linear')
sn.settexcoordsrc('uv0')
sn.setenabletransform(1)
sn.endtunit()
sn.sxyz0(2,2,2)
sn.begintunit(1)
sn.setaddress('wrap','wrap')
sn.setminmagfilter('linear','linear')
sn.settexcoordsrc('uv0')
sn.setenabletransform(1)
sn.endtunit()
sn.sxyz1(2,2,2)
sn.begintunit(2)
sn.setaddress('clamp','clamp')
sn.setminmagfilter('linear','linear')
sn.settexcoordsrc('spheremap')
sn.setenabletransform(1)
sn.endtunit()
sn.setlightenable(1)
sn.setdiffuse(1,1,1,1)
sn.setemissive(0,0,0,0)
sn.setambient(1,1,1,1)
sn.setalphaenable(0)
sn.setalphatestenable(1)
sn.setalpharef(0.7)
sn.setalphafunc('less')
sn.setcullmode('none')
ip=new ('nipol','ip')
sel ('ip')
ip.connect('txyz0')
ip.addkey3f(0,0,0,0)
ip.addkey3f(15,1,2,4)
sel ('..')
ip1=new ('nipol','ip1')
sel ('ip1')
ip1.connect('txyz1')
ip1.addkey3f(0,0,0,0)
ip1.addkey3f(20,-2,-4,-8)
sel ('..')
sel ('..')
tex=new ('ntexarraynode','tex')
sel ('tex')
tex.settexture(0,'../bmp/funky.bmp','../bmp/mask2.bmp')
tex.settexture(1,'../bmp/funky.bmp','../bmp/mask2.bmp')
tex.settexture(2,'../bmp/colorgloss.bmp','none')
sel ('..')
sel ('..')
